reference selectedUnit by unit index instead reference