add offset tree and modify dispatcher