fixed passing in wrong var