Setup state_machine but running into compatibility problems