FIX: ensures diversity code is not applied multiple times (PR #10517)

GitHub