fixed ta bug13,17, and add profile formatting