fixed assignment in if condition