Fixed the issue where every page load caused the server to restart