Added thread safe messages queue.