closes an open popup with escape key

References #951 
good point!just made change.