fix reference bug