fixed how errors are stored and error messages