fix assign loop