use _.each insead of for loop