fix segment error