Fixed invalid thread access