fixed bug with redirection to the login page