fix a index bug on refresh