fixed bug in expectHeaders