save function fix #2