On the calculation of two-photon ionization cross section