Added periodic refresh

I removed it for debugging but forgot to put it back