bugfix: fix header flashing and padding length changing