finish edit category function