Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
1. fix #427. 2. add headless test for this fix.