fixes issue #799