add refresh logic