Revert "alternative fix for bug #5887"

This reverts commit 80a98114ef07f680e868b5f92e5f6d0e5f8f103e.