added file error handling