Fixed the segmentation faul when the input contained just spaces