possible fix to #840