Revert part of #3108 to avoid rendering garbage memory