check on max category, resolves #3