fix getStructureFromElement