fix checking logic to duplicate running