implementation expand/collapse an item