fix bugs in parting