properly implemented connecting to zookeeper