Added waitForFinished() method to AsyncTask to allow for code to block until a task completes.