threading adjustments and alterations to fix some errors