Fixed login to correctly detect if user exists in db