Segmentation fault on RecordStream in node.js

Segmentation fault on client.close()

    let indexFilter = Aerospike.filter.equal(bin, value),
    
    Aerospike.connect(this.config)
    .then(client => { 
        let Query = client.query(this.namespace, this.set)
        Query.where(indexFilter)
            
        let stream = Query.foreach()
        stream.on('error', error => reject(error))
        stream.on('data', record => { stream.abort(); })
        stream.on('end', () => { stream.aborted ? resolve(true) : resolve(false);
          client.close()
          // without closing the connection it runs ok.
        
        })
       
    })
    .then(client => { console.log(client) })
    .catch(error => reject(error))