exception handling for fetching file