Fixed one glaring bug in insertAndConnect