Add function to check categories match