fixed bugs in header search