thread safe problem with message template solved