add mutex lock for thread safe messages