fixes refresh bug