Add more debugging.
Stop console window showing.
Close debug file.