refreshList function (first attempt)