Added Index increment which was left out in the last commint and added a log statement.