modified Controller.php