solve seg fault issue