added rebuildVars()