safe operation management with gcd