Fix login redirection bug