fixed insert bugs.