fixed errors on referesh