Add retry and some logging