         
         self.context.queries[command.requestID] = command.promise
         
-        _ = self.channel.writeAndFlush(command)
-        
-        return promise.futureResult
+        return self.channel.writeAndFlush(command).then { promise.futureResult }
     }
     
     /// Executes the given MongoDB command, returning the result

        
        return self.execute(command: ConnectionHandshakeCommand(application: app, collection: commandCollection)).map { reply in
            self.handshakeResult = reply
            
            
            self.clientConnectionSerializer.supportsOpMessage = reply.maxWireVersion >= 6
            

        return ServerReply(responseTo: responseTo, cursorId: cursorId, documents: documents)
    }
    
    static func message(fromBuffer buffer: inout ByteBuffer, responseTo: Int32, header: MessageHeader) throws -> ServerReply {
        // Read flags
        // TODO: The first 16 bits (0-15) are required and parsers MUST error if an unknown bit is set.
        let rawFlags = try buffer.assertLittleEndian() as UInt32
