fixed copypasta snipped by using local variable names;