fix reference to wrong variable