fix refresh bugs