Fixed a problem with login redirecting