diff --git a/abort-long-running-jobs.groovy b/abort-long-running-jobs.groovy
index 278c4c3..b4a63f3 100644
--- a/abort-long-running-jobs.groovy
+++ b/abort-long-running-jobs.groovy
@@ -5,25 +5,34 @@
  */
 common = new com.mirantis.mk.Common()
 
-def MAX_ALLOWED_DURATION_IN_SECONDS = 3600 * Interger.parseInt(MAX_DURATION_IN_HOURS)
-
-for (int i=0; i < Jenkins.instance.items.size(); i++) {
-  def job = Jenkins.instance.items[i]
-  def runningBuilds = job.builds.findAll{build -> build.isBuilding()}
-  def jobName = job.name
-  for(int j=0; j < runningBuilds.size(); j++){
-    def build = runningBuilds[j]
-    int durationInSeconds = (System.currentTimeMillis() - build.getTimeInMillis())/1000.0
-    if(durationInSeconds > MAX_ALLOWED_DURATION_IN_SECONDS){
-      common.infoMsg("Aborting ${job.name}-${build.id} which is running for ${durationInSeconds}s")
-      try{
-        build.finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build by long running jobs killer"));
-      }catch(e){
-        common.errorMsg("Error occured during aborting build: Exception: ${e}")
+def MAX_ALLOWED_DURATION_IN_SECONDS = 3600 * Integer.parseInt(MAX_DURATION_IN_HOURS)
+node{
+  stage("Kill long running jobs"){
+    def jobKilled = false
+    for (int i=0; i < Jenkins.instance.items.size(); i++) {
+      def job = Jenkins.instance.items[i]
+      def runningBuilds = _getRunningBuilds(job)
+      def jobName = job.name
+      for(int j=0; j < runningBuilds.size(); j++){
+        def build = runningBuilds[j]
+        int durationInSeconds = (System.currentTimeMillis() - build.getTimeInMillis())/1000.0
+        if(durationInSeconds > MAX_ALLOWED_DURATION_IN_SECONDS){
+          common.infoMsg("Aborting ${job.name}-${build.id} which is running for ${durationInSeconds}s")
+          try{
+            build.finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build by long running jobs killer"));
+          }catch(e){
+            common.errorMsg("Error occured during aborting build: Exception: ${e}")
+          }
+        }
       }
     }
+    if(!jobKilled){
+      common.infoMsg("No job aborted")
+    }
   }
 }
 
-
-
+@NonCPS
+def _getRunningBuilds(job){
+  return job.builds.findAll{build -> build.isBuilding()}
+}
\ No newline at end of file
