modified fix for #531

the fix prior to this failed.