diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
index e2922b2..84783c2 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
@@ -168,7 +168,7 @@
         <button
           [attr.data-tests-id]="'startFromScratchButton'"
           type="button" class="btn btn-success submit startFromScratchButton"
-          (click)="closeModal()"><span>Start from Scratch</span>
+          (click)="closeModalAndOpenNewServiceModal()"><span>Start from Scratch</span>
         </button>
       </div>
     </div>
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts
index 20655d5..1c86b3d 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts
@@ -1,7 +1,7 @@
 import {Component, OnDestroy, OnInit} from "@angular/core";
 import {DialogComponent, DialogService} from "ng2-bootstrap-modal";
 import {IframeService} from "../../../utils/iframe.service";
-import {ActivatedRoute} from "@angular/router";
+import {ActivatedRoute, Router} from "@angular/router";
 import {ServiceInfoService} from "../../../server/serviceInfo/serviceInfo.service";
 import {InstantiationTemplatesModalService} from "./instantiation.templates.modal.service";
 import {InstantiationTemplatesRowModel} from "./instantiation.templates.row.model";
@@ -20,6 +20,7 @@
 
 export class InstantiationTemplatesModalComponent extends DialogComponent<string, boolean> implements OnInit, OnDestroy {
 
+  serviceModelId: string = null;
   selectedInstantiation: InstantiationTemplatesRowModel = null;
   templateModalComponentService: InstantiationTemplatesModalService;
   originalTableData: InstantiationTemplatesRowModel[] = [];
@@ -34,6 +35,7 @@
               private _instantiationStatusComponentService: InstantiationStatusComponentService,
               private _aaiService: AaiService,
               private _store : NgRedux<AppState>,
+              private _router : Router,
               private _route: ActivatedRoute) {
     super(dialogService);
     this.templateModalComponentService = _templateModalComponentService;
@@ -44,8 +46,8 @@
     this._route
       .queryParams
       .subscribe(params => {
-
-        const getServiceJobInfoRoute = this._serviceInfoService.getTemplatesInfo(true, params['serviceModelId']);
+        this.serviceModelId = params['serviceModelId'];
+        const getServiceJobInfoRoute = this._serviceInfoService.getTemplatesInfo(true, this.serviceModelId);
         const getUserIdRoute = this._aaiService.getUserId();
 
         forkJoin([getServiceJobInfoRoute, getUserIdRoute]).subscribe(([jobs]) => {
@@ -70,4 +72,9 @@
   closeModal(): void {
     this._iframeService.closeIframe(this.dialogService, this);
   }
+
+
+  closeModalAndOpenNewServiceModal(): void {
+    this._templateModalComponentService.navigateToNewServiceModal(this.serviceModelId);
+  }
 }
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
index a17abed..308597a 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
@@ -2,7 +2,7 @@
 import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
 import {InstantiationTemplatesModalService} from "./instantiation.templates.modal.service";
 import {AaiService} from "../../../services/aaiService/aai.service";
-import {ActivatedRoute} from "@angular/router";
+import {ActivatedRoute, Router} from "@angular/router";
 import {IframeService} from "../../../utils/iframe.service";
 import {NgRedux} from "@angular-redux/store";
 import {FeatureFlagsService} from "../../../services/featureFlag/feature-flags.service";
@@ -17,16 +17,25 @@
   }
 }
 
-class MockAppStore {
+//
 
-}
+
+class MockAppStore {}
 
 describe('instantiation templates modal service', () => {
+  const serviceModelId :string = 'serviceModelId';
   let injector;
   let service: InstantiationTemplatesModalService;
   let httpMock: HttpTestingController;
   let _aaiService: AaiService;
   let _activatedRoute: ActivatedRoute;
+  let _router : Router;
+
+
+
+  let router = {
+    navigate: jasmine.createSpy('navigate')
+  };
 
   beforeAll(done => (async () => {
     TestBed.configureTestingModule({
@@ -35,6 +44,7 @@
         IframeService,
         AaiService,
         FeatureFlagsService,
+        { provide: Router, useValue: router },
         {provide: ActivatedRoute, useClass: ActivatedRouteMock},
         {provide: NgRedux, useClass: MockAppStore}
       ]
@@ -46,6 +56,7 @@
     httpMock = injector.get(HttpTestingController);
     _aaiService = injector.get(AaiService);
     _activatedRoute = injector.get(ActivatedRoute);
+    _router = injector.get(Router);
 
   })().then(done).catch(done.fail));
 
@@ -157,4 +168,12 @@
     expect(result).toHaveLength(0);
   });
 
+
+  test('navigateToNewServiceModal should navigate to new service modal', ()=>{
+
+    service.navigateToNewServiceModal(serviceModelId);
+
+    expect(_router.navigate).toBeCalledWith(["/servicePopup"], {"queryParams": {"isCreate": true, "serviceModelId": serviceModelId}, "queryParamsHandling": "merge"});
+  })
+
 });
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts
index 36691fd..c175918 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts
@@ -1,10 +1,13 @@
 import {Injectable} from "@angular/core";
 import {InstantiationTemplatesRowModel} from "./instantiation.templates.row.model";
+import {Router} from "@angular/router";
 import * as _ from 'lodash';
 
 @Injectable()
 export class InstantiationTemplatesModalService {
+  constructor(private _router : Router){
 
+  }
   convertResponseToUI = (jobsResponse: any[]): InstantiationTemplatesRowModel[] => {
     let tableRows: InstantiationTemplatesRowModel[] = [];
 
@@ -25,4 +28,9 @@
     return [];
   };
 
+
+  navigateToNewServiceModal(serviceModelId: string) {
+     this._router.navigate(['/servicePopup'], { queryParams: { serviceModelId: serviceModelId, isCreate:true}, queryParamsHandling: 'merge' });
+  }
+
 }
diff --git a/vid-webpack-master/src/app/shared/utils/iframe.service.ts b/vid-webpack-master/src/app/shared/utils/iframe.service.ts
index ab93d1a..e1ef59f 100644
--- a/vid-webpack-master/src/app/shared/utils/iframe.service.ts
+++ b/vid-webpack-master/src/app/shared/utils/iframe.service.ts
@@ -6,19 +6,19 @@
 
   addClassOpenModal(elementClassName: string) {
     const parentBodyElement = parent.document.getElementsByClassName(elementClassName)[0];
-    if (parentBodyElement)  {
+    if (parentBodyElement) {
       parentBodyElement.classList.add("modal-open");
     }
   }
 
   removeClassCloseModal(elementClassName: string) {
     const parentBodyElement = parent.document.getElementsByClassName(elementClassName)[0];
-    if (parentBodyElement)  {
+    if (parentBodyElement) {
       parentBodyElement.classList.remove("modal-open");
     }
   }
 
-  closeIframe(dialogService : DialogService, that){
+  closeIframe(dialogService: DialogService, that) {
     this.removeClassCloseModal('content');
     dialogService.removeDialog(that);
     setTimeout(() => {
@@ -27,16 +27,17 @@
   }
 
 
-  addFullScreen(){
-    let parentBodyElement =  parent.document.getElementsByClassName('service-model-content')[0];
-    if (parentBodyElement)  {
+
+  addFullScreen() {
+    let parentBodyElement = parent.document.getElementsByClassName('service-model-content')[0];
+    if (parentBodyElement) {
       parentBodyElement.classList.add("full-screen");
     }
   }
 
-  removeFullScreen(){
-    let parentBodyElement =  parent.document.getElementsByClassName('service-model-content')[0];
-    if (parentBodyElement)  {
+  removeFullScreen() {
+    let parentBodyElement = parent.document.getElementsByClassName('service-model-content')[0];
+    if (parentBodyElement) {
       parentBodyElement.classList.remove("full-screen");
     }
   }
