fixed bug in tpg partrepair