Added method to execute a command in the GUI