Adding header protection and erase()