fix missing logic where previous stacks would allow transition from any index