refactored register user to add user