fixes issue #4039