create class method to register user