updated checks for server being stopped