fixed issue with index metho