Dropdown have to click 2 to reopen

I need urgent help with my dropdown filter. I am using a dropdown to hold the filters for isotope filter, so when something is clicked it loads into the same page.

I have used custom code js to close the menu on click, but when closed it needs to be clicked twice to reopen.

https://preview.webflow.com/preview/tvsarchitects-b8929b1fbde4829d309eff9d1?utm_medium=preview_link&utm_source=designer&utm_content=tvsarchitects-b8929b1fbde4829d309eff9d1&preview=61e13f0e44c1c285f9fd8c40f9f8412e&pageId=64c6ebe938d1cffc020eb84f&workflow=preview

Any ideas would be appreciated.
Thanks