Fix sync bug with Next and Previous buttons