Added error logging (to .txt)
Added error logging (to .txt)