Added exception handling for invalid files.