move exception handling to controller