completed saving categories to the database