fixes issue 1340