add retry limit for unexpected errors