Use substring to get priority