add retry and error handle support