create thread using thread class