fix errors during rotate and resume/restore