fix for #1047