This processing should be done in the "addNewKind" if statement.

In addition, 
> target = this.$.actionPopup.getTargetComponent(target);
> beforeId = inEvent.beforeId; 

should also go the in the "addtoKind" if statement