Changed for loops in web client to forEach, so have closure