fixed getNextJob for SJF