adding ability to prevent closing of the menu on selection and a close handler