fix for #1340

this fixes issue #1340