fix rendering when reloading page