private void fetchRecord(String name) {

    	try {
            if (db.isRemote()) {
                this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            }
            JPanel plotHolder = new JPanel();
            plotHolder.setBackground(Color.WHITE);
            plotArea.add(plotHolder);

            ArrayList<String> v = db.getCollections();
            ArrayList<PlotPanel> plots = new ArrayList<PlotPanel>();
            double maxdim = -100000;
            double mindim = 100000;
            
            // loop through all the collections to get the average maf
            double totalMaf = 0;
            int totalSamples = 0;
            for (String collection : v) {
				PlotData pd = db.getRecord(name, collection, getCoordSystem());				
				if (pd.generatePoints() != null) {
					pd.computeSummary();
					int sampleNum = db.samplesByCollection.get(collection).getNumInds();
	            	totalMaf += pd.getMaf() * sampleNum;
	            	totalSamples += sampleNum;
				}
            }

            for (String c : v) {
                PlotPanel pp = new PlotPanel(this, c, db.getRecord(name, c, getCoordSystem()), plotWidth, plotHeight, longStats.isSelected(), totalMaf, totalSamples);

                pp.refresh();
                if (pp.getMaxDim() > maxdim) {
                    maxdim = pp.getMaxDim();
                }
                if (pp.getMinDim() < mindim) {
                    mindim = pp.getMinDim();
                }
                plots.add(pp);
            }

            for (PlotPanel pp : plots) {
                pp.setDimensions(mindim, maxdim);
                plotHolder.add(pp);
            }
        } catch (IOException ioe) {
            JOptionPane.showMessageDialog(this, ioe.getMessage(), "File error",
                    JOptionPane.ERROR_MESSAGE);
        } finally {
            this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));            
        }
    }