fix syntax for hash value call in loop for index method