implemented error-checking for invalid .csv files