Fix refresh bug