catch errors in computation