added checking if user is in database