Divided JS functions
isConnected added