Fix some erros with terminal.osa

i found an error with the last update and now i added a validation to see if the terminal process is open.