making right redirection after asking for login