Better error handling for saving path