fix wrong variable use