use domain if available to catch async errors