Changed checking network connection
Improved working 'check connection'