fix referencing issues