fixed sp segment bug