adding close event for the overlay