Fix pty option setting in execute command 

This is a fix for using sudo in execute command. Otherwise you may get "sorry, you must have a tty to run sudo" error.