Changed controller to print error