Moved the iteration loop to the correct part of the block (around the find_element action)