Avoid task being removed if schedule is invalid