ultimately fixed same-variable bug