 		let shouldWatch = connections.first(where: { $0.watchingVariaables }) != nil
 		// either toggle if overall change in state, otherwise ask for updated list so socket can know all the current values
 		do {
-			var cmd = try coder.toggleVariableWatch(enable: shouldWatch, contextId: params.contextId)
+			var cmd = try coder.toggleVariableWatch(enable: shouldWatch, contextId: params.environmentId)
 			if shouldWatch, shouldWatch == watchingVariables {
 				// ask for updated values
-				cmd = try coder.listVariables(deltaOnly: false, contextId: params.contextId)
+				cmd = try coder.listVariables(deltaOnly: false, contextId: params.environmentId)
 			}
 			try worker?.send(data: cmd)
 			watchingVariables = shouldWatch


	private func handleGetVariable(params: SessionCommand.VariableParams, connnection: SessionConnection) {
		do {
			let cmd = try coder.getVariable(name: params.name, contextId: params.contextId, clientIdentifier: connnection.id)
			try worker?.send(data: cmd)
		} catch {
			logger.warning("error getting variable: \(error)")

	}
	
	func handleVariableValueResponse(data: ComputeResponse.VariableValue) {
		let value = SessionResponse.VariableValueData(value: data.value, environmentId: data.contextId)
		let responseObject = SessionResponse.variableValue(value)
		if let clientId = data.clientId {
			broadcast(object: responseObject, toClient: clientId)
