fix errors handling for Erf