fixed a mistake in insert implementation