Removed syntax error after each loop change