Make the error message access thread safe