Fixed issue with segmentation fault when invalid file selecte