added functions to update UI