fixed testIndexBy error