added a check to see if a file was loaded into the program and print in error if other wise