fixed issue when 'unit' is not given to 'getUnitType'