fixed redirecting for logging in and out