fixed scheduler bug