keep track of selected menu items on dir change