Fix scheduler bug issue #5