fix bugs in ipm