Add working retry logic