Fixed weird redirect problem with login