Corrected controller to report errors