catch errors in processing functions