update pk and keys