Fix failed statechange

The 3. if evaluation never happened because after 10000 the 2. is always true, removed the else-statement