fix escape behaviour