In order to reconstruct the plasma current density, the Current Profile Fitting (CPF) code has been successfully developed on the HL-2A tokamak. A seven-channel motional Stark effect (MSE) diagnostic based on dual photoelastic modulators is installed to measure the pitch angle of the magnetic field, which can be used as an internal magnetic field constraint for the CPF code. Recently, the MSE polarimeter was upgraded with a real-time wavelength matching system to improve the signal-to-noise ratio. The magnetic field angle (γpitch) with a temporal resolution of 10 ms can be provided. In the CPF code, the plasma current density is described as a polynomial, and the Least-Squares method is used to determine the coefficients of the polynomial. The Finite Difference method and the Strongly Implicit Procedure method are used to solve the Grad-Shafranov equation. The code operation is stable. With the improved-quality MSE data, the CPF calculation result of shot 30782 suggests that the safety factor q profile is monotonic. The minimum q value is less than 1 on-axis during sawtooth oscillations in shot 30782. And, the position of the q = 1 surface is consistent with the sawtooth inversion radius measured by electron cyclotron emission and soft X-ray diagnostics.