fix two bugs about perfcounter