working TerminateTask()