Added optimistic locking for note model