app: fix bug in AddUnit method