ensure proper error reporting