some bug with save function