fix the redirection when logs in