optimistic locking on a document with validation