Revert "Revert "Revert "bug fix"""

This reverts commit 1f950a96a565017f548dad13d6e541ea93b66a1a.