update refresh function