fix segm fault totaly