fix bug in synchronizing index arrays