set position of bytearray to 0 before checking atf head