better fix for #636