changed database function to take a User rather than List<User>