added isConnected, more issues fixed. sorted index seems to work fine
now