change: seg_add function implementation has been changed.