add code for reorg