Correct logic which prevent double running job