convered all scripts to use threadRegulator when needed to ensure fair thread execution