Fixed the save function of categories