implemented feature to allow menu close if the overlay is clicked