fixed previous commit; index of new repeat correction + jsbeautified