public function saveStatus($serviceName, $attributeName, $value, $flush = false) {
        // before writing we load the data no matter what
        $this->loadStatsArray();

        // if this service is unknown add it to dirty array
        $this->dirtyStats[$serviceName][$attributeName] = $value;
        $this->stats[$serviceName][$attributeName] = $value;

        if ($flush) {
            // force reload stats
            $this->stats = false;
            $this->loadStatsArray();

            // merge all dirty stats into the oryginal array
            foreach ($this->dirtyStats as $service => $values) {
                foreach ($values as $name => $value) {
                    $this->stats[$service][$name] = $value;
                }
            }

            // force save
            $this->saveStatsArray();

            // next time we wont override these any more (they could change in the mean time)
            $this->dirtyStats = array();
        }
    }