fix corruption in head