Fixed connection error when reloading webpage and deploying.