fix minor bug on insert function

fix minor bug on insert function