Infinite loop in Worker.run()