fixed the issue that was casting element objects into arrays, and thus killing every element nested.