fixed destructor by using finished signal of QThread