Eliminating infrared divergences in the pressure