fixed some bugs , connect threads now running