check for presence of categories first