Added checks on length of categories and tags