accordion - close menu item before open

accordion - close menu item before open

Hello,

I would like to make what seems to be a minor change or update the accordion plugin.
When opening a menu item I would like the already opened item to close first, and then open the newly selected menu item.
Is it possible to do this?