better defining of errors