added method to check if there is an available network and finished with comments in main activity