apply Marco's patch to fix the customize function after #5807