catch errors in communicate()