Added code to make close active display on pressing the Escape key