delete first and last segment boundary