added messages queues and toAgent thread