changed the code so that I can debug over night using a redirect to an error file and let it run all night long