change variable name

Changes the argument to the correct name. The script worked the before,
because the variable inside the function was serendipitously the set to
the same name before each call.