fix the seg problem