updated for MP6
(cherry picked from commit 4303fa88b86a3e63a88bd17943f4e86772807181)