added try catch to all error message handler