functionality for closing the lightbox and keeping the url consistent