added caching to file (#yolo) and added error handling