make 3.0 compile
Fix bug in scheduler