added onEscape to dialog