added support for error messages