Cannot set property 'returnTo' of undefined