CHanged close locations function from api call to local function