mark while loop in login()