added escape key support