diff --git a/src/app/jobs.service.ts b/src/app/jobs.service.ts
index f1da4848b03395bd584bcdb61600d8caa97986ee..b1b097644232cc18909d635adb5e847886f48f73 100644
--- a/src/app/jobs.service.ts
+++ b/src/app/jobs.service.ts
@@ -33,6 +33,7 @@ export class JobsService {
   public refreshJobs() {
     if (this.id !== undefined && this.id !== null) {
       var query$: Observable<Job[]>;
+      console.log('refreshJobs');
       query$ = this.tes.runCommand(this.id, this.id.site.statcmd)
       query$.subscribe((qjobs) => this.jobs$.next(<Job[]>qjobs),
                        (error) => this.getJobsError(error,this.id))
@@ -41,6 +42,10 @@ export class JobsService {
   }
 
   public getJobsError(error,identity: Identity) {
+    if (error.hasOwnProperty('status') && error.status == 401) {
+      this.notifications.notify("Your login appears to have expired. Please log in again", () => { this.authService.updateAgentContents().subscribe((_) => {return}) } );
+      return;
+    }
     this.tsub.unsubscribe();
     if (identity.expiry < Date.now()) {
       this.notifications.notify("Your login has expired. Please log in again", () => { this.authService.updateAgentContents().subscribe((_) => {return}) } );
@@ -53,6 +58,7 @@ export class JobsService {
         return;
       } 
       this.notifications.notify("Unable to retrieve a list of running jobs.\nThe error messge was " + error.error.message);
+      console.log(error);
       return;
     }
     console.error(error);
diff --git a/src/app/launch-dialog/launch-dialog.component.ts b/src/app/launch-dialog/launch-dialog.component.ts
index 4a1ca6d1255a64c194848a5e8fb356ce377eb0ea..2854bf18a513dcc6840c1e6b1d7282424c3e00dd 100644
--- a/src/app/launch-dialog/launch-dialog.component.ts
+++ b/src/app/launch-dialog/launch-dialog.component.ts
@@ -89,7 +89,11 @@ export class LaunchDialogComponent implements OnInit {
       theme = 'strudel-light-theme';
     }
     if (this.identity !== null && this.app !== null) {
-      this.batchcmdurl = this.identity.site.url+"/"+encodeURIComponent(this.app.name)+"?theme="+theme;
+      if (this.app.batchcmdurl !== null) {
+        this.batchcmdurl = this.app.batchcmdurl+"?theme="+theme;
+      } else {
+        this.batchcmdurl = this.identity.site.url+"/"+encodeURIComponent(this.app.name)+"?theme="+theme;
+      }
     }
     this.batchcmdsafeurl = this.domSanitizer.bypassSecurityTrustResourceUrl(this.batchcmdurl);
     if (this.app.url !== null) {
diff --git a/src/app/strudelapp.ts b/src/app/strudelapp.ts
index 434343e60a1031f9287f56f11ba2e096bad36c13..bb0b3e475894e1dd82f630fff4caa78b15a7d666 100644
--- a/src/app/strudelapp.ts
+++ b/src/app/strudelapp.ts
@@ -8,6 +8,7 @@ export class AppAction {
 }
 export class Strudelapp {
   url: string; // A url used to retrieve extra config options. May be null
+  batchcmdurl: string = null; // if an app provides a batchcommandurl it overrides the url provieded for the site.
   name: string;
   startscript: string; // batch script ... should NOT include resource directives
                        // resource directives like #SBATCH belong in the batchinterface