Transformation optical devices based on the concept of complementary medium have attracted much attention due to their novel properties. A recent paper [H. Chen and C. T. Chan, Opt. Lett. 34, 2649 (2009)] showed a class of complementary medium in bipolar coordinates, which can render the object invisible at a distance. The prescription requires lossless materials composed of negative index medium (NIM), and a certain loss will cut off the cloaking effect of the device. In this paper, we suggest compensation to the lossy NIM by introducing gain media into such a device. For the realization of the whole cloaking device, we present an optimized compensation method to upgrade the function by adding a very thin layer of gain media in the surrounding medium. Numerical simulations demonstrate a dramatic improvement in the cloaking performance when the NIM is lossy.