fix job script lock detection

I honestly have no clue what the old code was trying to do