fixing the problem with writing headers when they were already written. I think only intercepting the vendors url is needed