fix refresh redirect bug