Added escape button functionality.