fix bug for ps_mat, pk_mat