fixed using wrong variable

This looks like a mistake, but I could be wrong.