fix domain caculation