fixed crashes on auto refresh