fixed bug with incorrect message handling when reusing worker