fixed refresh() on tab switching