refactored server side for when creating new user