fix for #312