fixed bug when there is no header