Fixed the closure issue by using an arrow function for the JSON load function