fixed using the wrong variable; related #1621