fix element references