fix bug when refresh