fix bugs in mq