fix reference issues