improve fix of issue 12860 for ddmd
Merge pull request #3636 from 9rnsr/fix12860

improve fix of issue 12860 for ddmd