closed #12: add escape logic