added loop to view