fix loop input