private function setMetaDataValue($id, $key, $value) {
        $data = $this->getMetaData($id);
        if (isset($data[$key])) {
            $data[$key] = $value;
        }
        else {
            throw new \Exception($key . ' is not defined in medatada');
        }
    }