fixing bug with refresh by adding a new update method and unit tests