Fix issues with automatic refreshing