fixed : hitting esc can revert the input to an old state