fixes issue #1020