fix escape press key behaviour