check if category already exists before persisting it