Fixes issue #5652

This fixes the issue #5652