worked on expand/collapse handling