fixes issue #246