add loop and rename bugs