invoke callback with error