add retry option (re-connect and re-run the command on error)