Use 'exists', not 'defined', to check for existence of hash entry