Hide modal on page change

So I have a modal, I have noticed if a user clicks their browser “back button” after viewing the modal if will lock up the site and have it greyed out as it thinks the modal is still in focus.

Is there a way to hide a modal if a user changes pages?

Example of what I’m talking about: If you click “View More Details” and then click your browser back button.
http://164.92.75.108/boats

Community Page
Last updated: