changed on/off to mutex and store_const