fixed extractLabel to use id if no label found