Changed the incorrect lodash function that was causing the loop to only occur once.