Verifying whether a key exists in the dictionary