Upgraded type checking for scheduler so that it throws an error instead of returning