fixed some thread bugs

statThread doesn't block final print