updated usersModel with error checking