Fixed issue 32. Check network connectivity before operation