repair the bug of save function