Fixed referencing bug