exit viewer when escape key is pressed