Solved seg fault issue