fix sending headers twice error