Avoid flickering effect when resource is reloaded