bringing in PR#6281