correctly redirects after login