catch exception if file cannot be read