Fixed bug in openTerminal method of the appDelegate