see #6565 for the bug fix