added support to close for error messages