revert lindex method from the master branch