add mutex to protect queue from chaotic access.