fix for #335