task terminator to be done inside the task