Fix compare_with_schema

- Check if _id exists before deleting