fix element referencing