console log and index change