fix escaping in generation