finish auto refresh function