added a nameExists method to check if user names are unique