Adding js to collapse menu after selection