fix the bug when inserting there is no header and tail