run exit function on error; fix
sanity test