fixed bug where error messages would persist