changes to fix reference error