anchor.diff:  							UserUpdate = lib_json:set_attrs([{"script",list_to_binary("ctx._source.triggers += newelement")},
   															 {"params","{}"},{"params.newelement","{}"},
   															 {"params.newelement.function",list_to_binary(Function)}, {"params.newelement.input",Input},
  -															 {"params.newelement.streams",Streams},{"params.newelement.streams",VirtualStreams},
  +															 {"params.newelement.streams",Streams},{"params.newelement.vstreams",VirtualStreams},
   															 {"params.newelement.output_type",list_to_binary("user")},{"params.newelement.output_id",list_to_binary(Username)}]),
   							case api_help:update_doc(?INDEX, "user", Username, UserUpdate) of
   								{error, {UPCode, UPBody}} -> 
  
positive.code: 					   _ -> 
  						   "stream"
  				   end,
  			NewTrigger = lib_json:set_attrs([{"function",list_to_binary(Function)},{"type",Type},{"streams",Streams},{"vstreams",VirtualStreams},{"outputlist","[{}]"},{"outputlist[0].input",Input},{"outputlist[0].output",["{}"]},{"outputlist[0].output[0].output_id",list_to_binary(Username)},{"outputlist[0].output[0].output_type",list_to_binary("user")}]),
  			case erlastic_search:index_doc(?INDEX, "trigger", NewTrigger) of	% Create new triggger if not in the system
  				{error,{Code2,Body2}} ->
  					ErrorString2 = api_help:generate_error(Body2, Code2),
  
negative.code: 							UserUpdate = lib_json:set_attrs([{"script",list_to_binary("ctx._source.triggers += newelement")},
  															 {"params","{}"},{"params.newelement","{}"},
  															 {"params.newelement.function",list_to_binary(Function)}, {"params.newelement.input",Input},
  															 {"params.newelement.streams",Streams},{"params.newelement.vstreams",VirtualStreams},
  															 {"params.newelement.output_type",list_to_binary("uri")},{"params.newelement.output_id",list_to_binary(URI)}]),
  							case api_help:update_doc(?INDEX, "user", User, UserUpdate) of
  								{error, {UPCode, UPBody}} -> 
  