check if hash key exists before reading