FIX: prevents mode to be forced to un-existing mode (PR #13413)

GitHub