assigne key to corresponding field