first shot at fixing #12147

Not complete, need some help here.