getting automatic refresh working