move _key_ definition to immediately before _getline()_