fixing bug with login redirection