fix bug when headers is empty