fix scheduler bug