fix variable bug in header search