fixed a bug in the partition scheduling algorithm