bug fix: should consider the size of header_t