Added escape rules to query.