Fixed prev/next flipflop issue