Fixed bug in client/worker mode