fixed a bug of saving modifications