Add handling external command function