getindex method for single name altered