fix headers handling