added simple diff mechanism to writer to only write if a resource changed