added cli debug flag; fixed bug for detecing missed ims