fixed the log rotating bugs