Add error handling for file loading