import java.io.IOException;

import models.Bundle;
import models.Query;
import models.Shapefile;
import models.User;
import controllers.Api;
import play.Application;
import play.GlobalSettings;
import play.api.mvc.EssentialFilter;
import utils.QueryResultStore;

public class Global extends GlobalSettings {
  
	@Override
	public void onStart(Application app) {
		Bundle.importBundlesAsNeeded();			
		
		// upload to S3
		try {
			Bundle.writeAllToClusterCache();
			Shapefile.writeAllToClusterCache();
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}

		for (Query q : Query.getAll()) {
			if (!q.completePoints.equals(q.totalPoints)) {
				QueryResultStore.accumulate(q);
			}
		}
	}
}

@@ -1,33 +1,4 @@
-import java.io.IOException;%0A%0A
 impo
@@ -11,24 +11,24 @@
 els.Bundle;%0A
+
 import model
@@ -65,52 +65,8 @@
 le;%0A
-import models.User;%0Aimport controllers.Api;%0A
 impo
@@ -125,67 +125,59 @@
 ort 
-play.api.mvc.EssentialFilter;%0Aimport utils.QueryResultStore
+utils.QueryResultStore;%0A%0Aimport java.io.IOException
 ;%0A%0Ap
@@ -548,16 +548,44 @@
 %0A%09%09%09if (
+q.completePoints == null %7C%7C 
 !q.compl

fix crash with scenarios that have not started.