Removed some random whitespaces in the code, and app now checks for network without crashing