Fixed callback to properly signal termination on error