added error handling for cases when unable to find file to read