fixed some issues with writing the log and collecting the results