Add unit selection logic and being error checking