update prev and next,add parents