resize and loop