fix for each iterator: select elements were being treated as if they were a list rather than a single element, because they have a length property