added some changes to start and stop thread and textArea