Revert "revert changes made by #4205"

This reverts commit 20d29e5b6eaa9ff323b2c4e5e04d23d0d39cc3e5.