fixed for loop in view