Added first part of MQ thread