implementing auto refresh