improve error class