Updated to use AsyncTask