Added support for automatic request retrying