update login to check if user exists first