added callbacks to error reporting functions