added checking of categories when a new cat is added