@Override
        protected Void doInBackground() throws Exception {
            if (isHMapsLoaded()) {

                String query = queryBox.getText().trim();

                renderer.setHeight(scfStruct.getHeight());
                renderer.setWidth(scfStruct.getWidth());
                try {
                    scfStruct.setIcon(renderer.getIconFromSmiles(query));
                } catch (Exception ex) {
                    ex.printStackTrace();
                }




                Scaffold scf = (Scaffold) getQueryIndexFromMap(scaffoldList, query);
                if (scf != null) {
                    scfName.setText(scf.getIUPACname());
                    scfLogP.setText(String.valueOf(scf.getLogP()));
                    scfBMFrame.setText(scf.getBMframework());
                } else {
                    status.setText("Scaffold not found in the database!");
                }

                List<String> resList = (List<String>) getQueryIndexFromMap(invertedIndexMap, query);
                if (resList != null) {
//                      
                    total = resList.size();
                    status.setText(total + " results found in the database.");
                    for (String res : resList) {
                        try {
                            if (!isCancelled()) {

                                QueryResultPanel qResultPanel = new QueryResultPanel();
                                Drug resD = drugList.get(res.toLowerCase());
                                qResultPanel.setdName(resD.getName());
                                qResultPanel.setdSMILE(resD.getUniqueSMILE());
                                qResultPanel.setdInd(resD.getIndication());
                                qResultPanel.setdRef(resD.getDrugbankID());
                                renderer.setHeight(qResultPanel.getdStructDimension().height);
                                renderer.setWidth(qResultPanel.getdStructDimension().width);
                                qResultPanel.setdStruct(renderer.getIconFromSmiles(resD.getUniqueSMILE()));
                                queryResultData.addElement(qResultPanel);
                                loaded++;

                                setProgress(100 * loaded / total);
//                                publish();
                                status.setText(total + " results found in the database. " + getProgress() + "% loading complete");


                            } else {

                                status.setText(status.getText() + "--load cancelled!");
                                break;
                            }

                        } catch (InvalidSmilesException ex) {
                            Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
                        } catch (CDKException ex) {
                            Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                } else {
                    Utility.UI.showInfoMessage(getRootPane(), "No drug contains the scaffold provided!");
                    status.setText("Scaffold not found in the database!");
                }


                // Utility.UI.showInfoMessage(getRootPane(), res.toString());        
            } else {
                Utility.UI.showInfoMessage(getRootPane(), "HMaps not loaded!");
            }
            return null;

        }