fix for #1019
fix for #1058