replaced insert key array check  with regex