added waitForResponses in tests