finally fixed the header size and reset