fix insert and pop