Add some logging
Refresh logic fixes