correct error in maincontroller.php