Use correct waiting mechanism to wait DB and WS ok