executeCommand method