add onExpand and onCollapse callbacks