modify controller to handle exception