add collapse function when click on menu item