rough fix for #805