Now tests for internet connection.
Now working offline as well as online.