fix issue where infinite loop could occur if no root nodes available for scheduling