moved debug msgs from err.out to logfile