fix gcd