fix #11003

Fixes #11003.
/to @mdo for ASAP review. Would like to get this into v3.0.1.