implemented the onClick functionality of the refresh button