update pat_key handling