Revert "Revert "fix a bug""

This reverts commit 44f16884a1480c5cf89b8568ce100c44af7a21a3.