Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java	(revision 6775)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java	(revision 6776)
@@ -8,63 +8,53 @@
 import org.openstreetmap.josm.actions.DownloadAction;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-
- 
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.layer.Layer;
 
 public class DownloadWMSTask extends PleaseWaitRunnable {
 
 	private WMSLayer wmsLayer;
-	private double minlat, minlon, maxlat, maxlon;
+	private Bounds bounds;
 	
-	/* whether our layer was already added. */
-	private boolean layerAdded = false;
-	
-	
-	public DownloadWMSTask(String name, String wmsurl) {
-		super(tr("Downloading " + name));
+	public DownloadWMSTask(WMSLayer wmsLayer, Bounds bounds) {
+		super(tr("Downloading " + wmsLayer.name));
 
-		// simply check if we already have a layer created. if not, create; if yes, reuse.
-		if (wmsLayer == null) {
-			if (wmsurl.matches("(?i).*layers=npeoocmap.*") || wmsurl.matches("(?i).*layers=npe.*") ){
-				//then we use the OSGBLayer
-				this.wmsLayer= new OSGBLayer(name, wmsurl);
-			} else {
-				this.wmsLayer = new WMSLayer(name, wmsurl); 
-			} 
-		} 
-	
+		this.wmsLayer = wmsLayer;
+		this.bounds = bounds;
 	}
 	
 	@Override public void realRun() throws IOException {
 		Main.pleaseWaitDlg.currentAction.setText(tr("Contacting WMS Server..."));
-		wmsLayer.grab(minlat,minlon,maxlat,maxlon);
+		wmsLayer.grab(
+			bounds.min.lat(), bounds.min.lon(),
+			bounds.max.lat(), bounds.max.lon());
 	}
 
-	@Override protected void finish() {
+	@Override protected void cancel() {}
+	@Override protected void finish() {}
 
-		// BUG if layer is deleted, wmsLayer is not null and layerAdded remains true!
-		// FIXED, see below
-		
-		layerAdded = false;
-		for (Iterator it = Main.map.mapView.getAllLayers().iterator(); it.hasNext(); ) {
-			Object  element = it.next();
-			if (element.equals(wmsLayer)) layerAdded = true;
+	public static void download(String name, String wmsurl,
+			double minlat, double minlon, double maxlat, double maxlon) {
+		WMSLayer wmsLayer = null;
+
+		// simply check if we already have a layer created. if not, create; if yes, reuse.
+		for (Layer l : Main.main.map.mapView.getAllLayers()) {
+			if (l instanceof WMSLayer && l.name.equals(name)) {
+				wmsLayer = (WMSLayer) l;
+			}
 		}
-				
-		if ((wmsLayer != null) && (!layerAdded))
-		{
+
+		if (wmsLayer == null) {
+			if (wmsurl.matches("(?i).*layers=npeoocmap.*") || wmsurl.matches("(?i).*layers=npe.*") ){
+				//then we use the OSGBLayer
+				wmsLayer= new OSGBLayer(name, wmsurl);
+			} else {
+				wmsLayer = new WMSLayer(name, wmsurl); 
+			}
 			Main.main.addLayer(wmsLayer);
-			layerAdded = true;
-		}
-	}
+		} 
 
-	@Override protected void cancel() {
-	}
-
-	public void download(DownloadAction action, double minlat, double minlon, double maxlat, double maxlon) {
-		this.minlat=minlat;
-		this.minlon=minlon;
-		this.maxlat=maxlat;
-		this.maxlon=maxlon;
-		Main.worker.execute(this);
+		Main.worker.execute(new DownloadWMSTask(wmsLayer,
+			new Bounds(new LatLon(minlat, minlon), new LatLon(maxlat, maxlon))));
 	}
 }
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Map_Rectifier_WMSmenuAction.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Map_Rectifier_WMSmenuAction.java	(revision 6775)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Map_Rectifier_WMSmenuAction.java	(revision 6776)
@@ -21,5 +21,4 @@
 
 	}
-	DownloadWMSTask downloadTask;
 
 	public void actionPerformed(ActionEvent e) {
@@ -42,11 +41,7 @@
 				//System.out.println(newURL);
 
-			//	if (downloadTask == null){
-					//System.out.println("new download task!");
-					downloadTask = new DownloadWMSTask("rectifier id="+newid, newURL);
-			//	}
 				MapView mv = Main.map.mapView;
 
-				downloadTask.download(null,
+				DownloadWMSTask.download("rectifier id="+newid, newURL,
 						mv.getLatLon(0, mv.getHeight()).lat(),
 						mv.getLatLon(0, mv.getHeight()).lon(),
Index: plications/editors/josm/plugins/wmsplugin/src/wmsplugin/NPE_WMSmenuAction.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/NPE_WMSmenuAction.java	(revision 6775)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package wmsplugin;
-
-import java.awt.event.ActionEvent;
-
-import javax.swing.AbstractAction;
-
-import javax.swing.JOptionPane;
-
-import org.openstreetmap.josm.Main;
-
-
-public class NPE_WMSmenuAction extends AbstractAction {
-
-	/**
-	 * 
-	 */
-	
-
-	public NPE_WMSmenuAction() {
-		super("Use NPE maps");
-		
-	}
-	
-	public void actionPerformed(ActionEvent e) {
-	
-		/*String npeURL = ("	http://www.getmapping.com/iedirectimage/getmappingwms.aspx?"+
-			"srs=EPSG:27700&Service=WMS&Version=1.1.0&"+
-			"Request=GetMap&format=image/jpeg&layers=npeoocmap");*/
-		
-		String npeURL = ("http://nick.dev.openstreetmap.org/openpaths/freemap.php?layers=npe&");
-			
-		
-
-			Main.pref.put("wmsplugin.url", npeURL);	
-	
-			JOptionPane.showMessageDialog(null, "WMS set to New Public Edition.");
-		
-		//need to reset the particular download task
-		//DownloadWMSTask
-		
-		for (int i = 0; i < Main.main.menu.download.dialog.downloadTasks.size(); ++i) {
-			
-			if (Main.main.menu.download.dialog.downloadTasks.get(i).getPreferencesSuffix().compareTo("wmsplugin") == 0){
-				
-				Main.main.menu.download.dialog.downloadTasks.remove(i);
-			}
-		}
-
-
-
-	}
-}
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java	(revision 6775)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java	(revision 6776)
@@ -17,15 +17,9 @@
 	
 	public void actionPerformed(ActionEvent e) {
-		
-		// store the download task with the "info" object. if we create a new
-		// download task here every time, then different layers are displayed even
-		// for images from the same server, and we don't want that.
 		System.out.println(info.url);
-		if (info.downloadTask == null)
-			info.downloadTask = new DownloadWMSTask(info.name, info.url);
 		
 		MapView mv = Main.map.mapView;
 		
-		info.downloadTask.download(null,
+		DownloadWMSTask.download(info.name, info.url,
 				mv.getLatLon(0, mv.getHeight()).lat(),
 				mv.getLatLon(0, mv.getHeight()).lon(),
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSInfo.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSInfo.java	(revision 6775)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSInfo.java	(revision 6776)
@@ -13,9 +13,7 @@
 	String url;
 	int prefid;
-	DownloadWMSTask downloadTask;
 	
 	public WMSInfo(String name, String url, int prefid) {
 		this.name=name; this.url=url; this.prefid=prefid;
-		downloadTask = null;
 	}
 	
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 6775)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 6776)
@@ -30,5 +30,4 @@
 	static String VERSION = "2.4";
 	
-	DownloadWMSTask task;
 	WMSLayer wmsLayer;
 	static JMenu wmsJMenu;
