task removal function