Fixed refresh bug