loop objects inside arrays