Fix last page saving bug