Fix foor loop in node app