bug fixes and retry option