fixed a bug where error messages not showing