fix assignment in if statement issue

because it doesn't match the logic either.