fix for #7203 and #6280