fix exit thread error