patch for bug-940520