altered start script to wait for discovery to start