fix: should assign parent segment to root segment if parent is not exists.