ensure async callback happens on error