fix bug: an error occurs at file rotation