fix the domain error