fixed issue where, if file didn't exist, the program would segfault