added register method to user