Add guard to hash_value for records