OK, I revised the saving function and it functions well now.