fix loop for test data generater
edited javascript