 				else if op is 'M'
 					s_data = @data.store[id]
 					if ('sv' of change and s_data? and s_data['version']? and s_data['version'] == change['sv']) or !('sv' of change) or (change['ev'] == 1)
-    					if not s_data?
-        					@data.store[id] =
-            					'id'        :   id
-            					'object'    :   {}
-            					'version'   :   null
-            					'last'      :   null
-            					'change'    :   null
-            					'check'     :   null
-        					s_data = @data.store[id]
+						if not s_data?
+							@data.store[id] =
+								'id'        :   id
+								'object'    :   {}
+								'version'   :   null
+								'last'      :   null
+								'change'    :   null
+								'check'     :   null
+							@_save_entity id
+							s_data = @data.store[id]
 #                        console.log "#{@name}: processing modify for #{JSON.stringify(s_data)}"
-    					orig_object = @jd.deepCopy s_data['object']
-    					s_data['object'] = @jd.apply_object_diff s_data['object'], change['v']
-    					s_data['version'] = change['ev']
-
-    					new_object = @jd.deepCopy s_data['object']
-
-    					if not ('local' of change)
+						orig_object = @jd.deepCopy s_data['object']
+						s_data['object'] = @jd.apply_object_diff s_data['object'], change['v']
+						s_data['version'] = change['ev']
+						
+						new_object = @jd.deepCopy s_data['object']
+						
+						if not ('local' of change)
 #                            setTimeout do(change, new_object, orig_object) =>
 #                                => @_notify_client change['id'], new_object, orig_object, change['v']
-        					@_notify_client change['id'], new_object, orig_object, change['v'], change['ev']
+							@_notify_client change['id'], new_object, orig_object, change['v'], change['ev']
 					else if s_data? and s_data['version']? and change['ev'] <= s_data['version']
-    					console.log "#{@name}: old or duplicate change received, ignoring, change.ev=#{change['ev']}, s_data.version:#{s_data['version']}"
+						console.log "#{@name}: old or duplicate change received, ignoring, change.ev=#{change['ev']}, s_data.version:#{s_data['version']}"
 					else
-    					if s_data?
-        					console.log "#{@name}: version mismatch couldnt apply change, change.ev:#{change['ev']}, s_data.version:#{s_data['version']}"
-    					else
-        					console.log "#{@name}: version mismatch couldnt apply change, change.ev:#{change['ev']}, s_data null"
-    					if s_data?
-        					@data.store[id]['version'] = null
-    					reload_needed = true
+						if s_data?
+							console.log "#{@name}: version mismatch couldnt apply change, change.ev:#{change['ev']}, s_data.version:#{s_data['version']}"
+						else
+							console.log "#{@name}: version mismatch couldnt apply change, change.ev:#{change['ev']}, s_data null"
+						if s_data?
+							@data.store[id]['version'] = null
+							@_save_entity id
+						reload_needed = true
 				else
 					console.log "#{@name}: no operation found for change"
 				if not reload_needed

		if s_data['last']? and @jd.entries(s_data['last']) > 0
			if @jd.equals s_data['object'], s_data['last']
				s_data['last'] = null
				@_remove_entity id
				return false

		change = @_make_change id
		if change?
			s_data['change'] = change
			@_queue_change change
		else
			@_remove_entity id
		return true

	update: (id, object) =>

					name:   @name
					clientid: @clientid
					build: @s.bversion
				if @initFromLocalStorage
					opts.cmd = "cv:#{@data.last_cv}"
				else if not @initialized
					opts.cmd = index_query
				console.error opts,  @initFromLocalStorage
				@initFromLocalStorage = 0
				@send("init:#{JSON.stringify(opts)}")
				console.log "#{@name}: sent init #{JSON.stringify(opts)} waiting for auth"
			else
