- fixed infinite loop if network is partitioned
- fixed wrong query for environment variable and output