Renamed variable to match parameter

Probably fixes an error, as that seems to be the reason it's put there. Made variable local too.