moved the i++ to try to fix the parser error