Trying to handle login-loop