Moved connection process into AsyncTask