add data saving

Signed-off-by: SButterfly <sbutterfly@outlook.com>