index can be either string or number.