fixed a bug on get_pk rutine.