Applying @FabriceMk fix to v50 branch

Applying @FabriceMk fix to v50 branch