add some error reporting