private boolean check_settings() {
			
		String apache = this.apacheDirectory.getText();
		File f = new File(apache);
		
		if (!f.isDirectory()) {			
			System.out.println("Invalid apache directory");
			setHelpMsg(rb.getString("ERROR_APACH_TOP"));
			JOptionPane.showMessageDialog(main.getFrame(), rb.getString("ERROR_APACH_TOP"));
			return false;		// not a valid directory
		}

		if (apache.endsWith("/"))
			apache = apache.substring(0, apache.length() -1);  // drop final '/'
		if (apache.endsWith("\\"))
			apache = apache.substring(0, apache.length() -1);  // drop final '\'
		
		String smileDir= apache + mainWindow.dir_name2save;  // .../apacheDir/SMILE
		f = new File (smileDir);
		if (!f.exists()) {
			setHelpMsg("The selected Apache directory does not contain the SMILE diectory. Please check if the setting for the Apache Directory is correct.");
			JOptionPane.showMessageDialog(main.getFrame(), smileDir + " directory does not exist. Please check if the setting for the SMILE Directory is correct.");
			return false;	
		}
		
		String pushMsg= smileDir + mainWindow.pushmsg;  // .../apacheDir/SMILE/pushmsg.php
		f = new File (pushMsg);
		if (!f.exists()) {
			setHelpMsg("The PUSH MSG script cannot be found. Please check if the SMILE Directory is correct.");
			JOptionPane.showMessageDialog(main.getFrame(), pushMsg + " file does not exist. Please check if the setting for the SMILE Directory is correct.");
			return false;	
		}
		
		String s = apache + mainWindow.subdir_name;   // ..../apacheDir/SMILE/current
		f = new File (s);
		if (!f.exists()) {
			setHelpMsg(s + " directory does not exist.");
			JOptionPane.showMessageDialog(main.getFrame(), s + " directory does not exist.");
			return false;
		 	/*try {
				f.mkdirs();
			} catch (Exception e) {
				System.out.println("Cannot create execution directory");
				setHelpMsg(rb.getString("ERROR_CREATE_JUNTION_TOP"));
			}*/
		}
		
		// set directory to main
		main.setDirectory(apache);
		
		if (!isReusePreviousQuestions()) data_source.clear();
				
		String s2 = s + "/MSG";
		f = new File (s2);
		if (!f.exists()) {
			setHelpMsg(s2 + " directory does not exist.");
			JOptionPane.showMessageDialog(main.getFrame(), s2 + " directory does not exist.");
			return false;
			/*try {
				f.mkdirs();
			} catch (Exception e) {
				System.out.println("Cannot create MSG directory");
				setHelpMsg(rb.getString("ERROR_CREATE_JUNTION_TOP"));
			}*/
		}
		
		// temp
		//String body = "No question available";
		create_not_available();
		/*
		String body = rb.getString("Q_NOT_AVAILABLE");
		f = new File (s + "/not_avail.html");
		
		try {
			FileWriter f0 = new FileWriter (f);
			f0.write(body);
			f0.close();
		} catch (IOException e) {
			
			e.printStackTrace();
		}*/
						
		return true;
	}