fixed for loop in rename