Remove the  event listener and exclusively check the status code once the server has loaded.