fixed bug with invalid received headers