title: _http_outgoing.js:371 throws new Error('Can\'t set headers after they are sent.');
body: <p>When I run the code the form gets filled for the first time, the result is displayed well. but when I refresh the page or click on submit I get this error :</p>
  
  <p><code>_http_outgoing.js:371 throw new Error('Can\'t set headers after they are sent.');</code></p>
  
  <hr>
  
  <p>Code for the program:</p>
  
  <pre><code>router.post('/send', function(req, res, next) {
  var currentUser=req.body.currentUserAddress
  var reciever= req.body.Addressedestinataire;
  var amount = req.body.somme;
  var data=[{"Spalte":amount}];
  var s =JSON.stringify(data[0].Spalte);
  var valueToken = JSON.parse(s);
  mytoken.transfer.sendTransaction(currentUser,reciever,amount,{from :web3.eth.accounts[0],gas:5000000},function (error, result)
   {
  
      if(result)
            { 
                  let event = mytoken.Transfer();
  
                   event.watch(function(err, response)
                  {
                      if (err) {
                          console.log ("Error="+ err);
                               }
                      if (!err) {
                           let addressEvent= response.address;
                           let addressTo=response.args.to;
                           let addressFrom =response.args.from;
                           Transaction={addressFrom,addressTo,amount,date}
                           db.open(function(err, db) {
  
                           let collection = db.collection("Transaction");
  
                           collection.insertOne(Transaction, function(err, result1) {assert.equal(null, err);});
                           db.close();
                                   });
            res.setHeader('Content-Type', 'application/json');
            res.send(JSON.stringify({addressEvent,addressFrom,addressTo,amount}));
  
                      }
         });
  
           }
     else{
    console.log(error);  
         }
  
      });
   });
  </code></pre>
  
  <p>`
  Any suggestions would be really appreciated.</p>