close the ims.