Fixing delete by query for resource policy