refactoring on the method that controls the state and scheduleState of objects to fix a bug when dealing with DE's. When we start/stop a DE, we have to control both State and ScheduleState.