Fixed the issue with sending headers