better management of "esc" handlers