fixed bugs in ctp