Moved looping call to connection made and killed the connection if it's lost