fix the bug for computing the schedule time