fix for #340