the correct way to test that a key exists