Added a close page function on Escape key