Segmentation fault fixed