Improved to be able to define agent name using external command.