Add collapse funciton on main js