Fix category check