fix page refresh bug