fixed a logic issue with unitSelected

formation fixing in progress