error handling registerCtrl