added getJSON and fixed index