fix wrong variable being used.