Final refresh bug fix in sub