fixed issue with redirect on login and register