fixed FCFS nextTask method