fixed bug in using header method