Hopefully fixed logging problem