added test for index method