fixed null segment issue