loop mispalced