This will only match the first 'required' category, but I'm sure there has to be a better way to do this.