fix reference errors