fix assignment in if statement issue

it doesn't look like overwriting a variable you just set is what you wanted to do here.