fix bugs in modify contract