fix the support for optional escaping on '}'