move resetVars to mapCtrl scope