private void updatedownload(Download download) {
        int gid = download.gid;

        if (downloads.containsKey(gid)) {
            downloads.put(gid, download);
        } else {
            addToList(download);
        }
    }