Moved dismissal of popup to after asynchtask is completed