make the esc key close the top most overlay and cleanup markup and titles after overlay closure