add decorator to catch intert exceptions