fix numerical issue