Update index variable and add missing semicolon