fixed passing of incorrect variable