fixed renaming issue in log_rotate function