Assign variable outside getJSON