fixed mistakenly swapped vars