more thread safety mods