added test for indexBy