fixes #11760 (closed) for 3.12
(cherry picked from commit 0095009d)
fixes #11760 (cherry picked from commit 0095009d)