finally working redirection after login