some file error handling