add direct save function