Changed save and load implementation