error reporting better design