Added code for executeCommand