added function to check if hash table value exists for a given key