adding a function to create parent categories when needed