fix wrong variable reference