fixed weirdness with element references