fixed a bug with destruction of workers