add callback to save

add callback to save