fix wrong variable usage