Fix issues when reloading the page