fix #310
part of the fix for #309