anchor.diff:  	ok = mnesia:write(service, S1, write),
   	S1;
   add_service1(Identity, Password, State, ProductRef,
  -		Chars, Attributes, EnabledStatus, MultiSession) ->
  +		Chars, Attributes, EnabledStatus, MultiSession, LM) ->
   	case mnesia:read(product, ProductRef, read) of
   		[#product{service = ServiceRefs} = P1] ->
   			case lists:member(Identity, ServiceRefs) of
   				false ->
  -					Now = erlang:system_time(millisecond),
  -					N = erlang:unique_integer([positive]),
  -					LM = {Now, N},
   					P2 = P1#product{service = [Identity | ServiceRefs],
   							last_modified = LM},
   					ok = mnesia:write(P2),
  
positive.code: 		Reason :: term().
  %% @doc Add a new bucket to bucket table or update exsiting bucket
  add_bucket(ProductRef, #bucket{id = undefined} = Bucket) when is_list(ProductRef) ->
  	F = fun() ->
  		case mnesia:read(product, ProductRef, write) of
  			[#product{balance = B} = P] ->
  				BId = generate_bucket_id(),
  				Bucket1  = Bucket#bucket{id = BId, product = [ProductRef]},
  				ok = mnesia:write(bucket, Bucket1, write),
  				Product = P#product{balance = lists:reverse([BId | B])},
  
negative.code: update_client(Address, Password) when is_list(Password) ->
  	update_client(Address, list_to_binary(Password));
  update_client(Address, Password) ->
  	TS = erlang:system_time(millisecond),
  	N = erlang:unique_integer([positive]),
  	LM = {TS, N},
  	F = fun() ->
  				case mnesia:read(client, Address, write) of
  					[Entry] ->
  						NewEntry = Entry#client{secret = Password, last_modified = LM},
  						mnesia:write(client, NewEntry, write);
  					[] ->
  						throw(not_found)
  