fix threads