first attempt at a retry mechanism