completed function edit categories