fixed case when all empty segments