more elegant fix  for #34