waitForReturnCapability: fix logic bug