Hopefully fixed up the scheduler