fix the problem causes from using a global empty segment