added retry logic