added loading dialog and internet check