fix elaborate error in cpa .. add cpa test bench