A new modified sparse approximate inverse preconditioning algorithm, MAINV, is proposed to improve the iterative solution of the linear system which is arised from the finite element method for analyzing the electromagnetic boundary problem. The proposed preconditioner is constructed by adding pivots compensation strategy to the very small pivots which may cause breakdowns during the basic AINV process. Therefore the high quality preconditioner can be achieved. Numerical examples show that the MAINV can dramatically accelerate the iteration of SQMR and other typical iterative methods. Moreover, MAINV is proved to achieve better performance by comparison with some standard preconditioners.