changed error handling bug when user not found in db.