fix for #522