set vars outside update function at tree.js