basic retry logic