diff --git a/src/SIM.Pipelines/Delete/CleanUp.cs b/src/SIM.Pipelines/Delete/CleanUp.cs
index 5ce7bf32..8cfa7d3d 100644
--- a/src/SIM.Pipelines/Delete/CleanUp.cs
+++ b/src/SIM.Pipelines/Delete/CleanUp.cs
@@ -26,12 +26,11 @@ protected override void Process([NotNull] ProcessorArgs args)
         return;
       }
 
-      Directory.Delete(arguments.Tasker.UnInstallParamsPath, true);
       InstallParam param = arguments.Tasker.GlobalParams.FirstOrDefault(p => p.Name == "DeployRoot");
       if (param!=null)
       {
-        int retrisNumber = 3;
-        for (int i=0;i<= retrisNumber; i++)
+        int retriesNumber = 3;
+        for (int i=0;i<= retriesNumber; i++)
         {
           if (Directory.Exists(param.Value))
           {
@@ -45,7 +44,7 @@ protected override void Process([NotNull] ProcessorArgs args)
             }
             if (Directory.Exists(param.Value))
             {
-              if (retrisNumber==i)
+              if (retriesNumber == i)
               {
                 throw new Exception($"Can't remove directory: {param.Value}");
               }
@@ -58,6 +57,8 @@ protected override void Process([NotNull] ProcessorArgs args)
           }
         }
       }
+
+      Directory.Delete(arguments.Tasker.UnInstallParamsPath, true);
     }
   }
 }