improved mobile navbar to collapse on selecting an item