log to temp on startup added. debug printouts left in because not satisfied with the temp file resolution