added progress dialog for decrypt and fixed the loop