change vars to volatile