Added refresh function to update charts