change to use QThread