Added script hook and clearing of terminal