changed method saveData