Fix bug on insert