fix the esc key bug to make the topmost verlay close