Implemented dead task removal