An improved immersed boundary method using a mass source/sink as well as momentum forcing is developed for simulating flows over or inside complex geometries. The present method is based on the Navier-Stokes solver adopting the fractional step method and a staggered Cartesian grid system. A more accurate formulation of the mass source/sink is derived by considering mass conservation of the virtual cells in the fluid crossed by the immersed boundary. Two flow problems (the decaying vortex problem and uniform flow past a circular cylinder) are used to validate the proposed formulation. The results indicate that the accuracy near the immersed boundary is improved by introducing the accurate mass source/sink. Copyright (c) 2006 John Wiley & Sons, Ltd.