added stopping of query using esc keypress