added a function saveCategory()