Error handling for incorrect file format