Fixed array to object breaking loop