added more safety in the new scheduler