Trying to fix an issue on write_rest() : not fixed yet