added exception handling for save and load