Fixed a bug in the behaviour of MessageProcessingThread