insert function added ut has some bugs to fix