fixed issue with login redirecting to the wrong page