Added #ifs to allow for debugging

if it saved crashes to a file during debugging, then it would crash
silently