backwards state machine fixed