fixes issue #515