Fixed possible condition when scheduling
Fix: typo from old code