Improve Agent (fix problem with update mode)