properly close escape sequence