fix LSdist threading