fix has_key for socket