add retry mechanism to doom function