added deleteThread