Fix reference to undefined variable

So this doesn't work at all. Let's fix it!