apply Marco's patch to fix the customize function after #5807
Merged refs/pull/6166/head from repository cms-sw