Add assert to test last ptr  for insert function