fixed calling every with number as stateIntervals; added test for calling every with number as stateIntervals