Wait for the server to start instead of having a hardcoded sleep