add error reporting in callbacks