add test provider for easier debugging
fix refresh logic