added checks for unit existing, removed vargs