Fixed seg fault problem. Other problems are arising.