created "switch" feature for expandable items