added esc key functionality