Added error handling while saving/loading data