implement esc keypress to invalidate the search