Fix syntax error in waiting loop for network

Fix syntax error in a change introduced in previous version to wait for the network