fixed segament fault