spawn thread in constructor