Made messages thread safe