Solved a bug when jenkins is building, the check failed because lastbuil...

...d != lastsuccessfullbuild.

Added condition in if statement to check if lastbuild is running.