Fix bug for p3 and p4.