Error handling for csv