fix the codes according to review results