added conditional to only check the escaped version if the escaped version does not match the unescaped version