nit: declare `element` locally