Added error handling for missing files