working register controller with model